﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SvnNotes;

namespace CodeplexOutputTransformer
{
    public class CodeplexOutputTransformer : IOutputTransformer
    {
        #region IOutputTransformer Members

        public Dictionary<string, EntryCollection> Entries { get; set; }

        public object Transform()
        {
            StringBuilder output = new StringBuilder();
            foreach (string key in Entries.Keys)
            {
                output.AppendFormat("!! {0}", key);
                output.AppendLine();
                foreach (Entry entry in Entries[key])
                {
                    output.AppendFormat("* {0}{1}", entry.Id, entry.Note);
                    output.AppendLine();
                }
            }

            return output.ToString();
        }

        #endregion
    }
}
